package com.hckj.jianzhijia.utils;

import com.avos.avoscloud.AVException;

/**
 * Created by 赵奇隆 on 2015-10-20.
 */
public class ExceptionUtils {

    public static String getExceptionInfo(AVException e) {
        String exceptionDesc = null;

        switch (e.getCode()) {

            case 0:
                exceptionDesc = "网络问题请重试";
                break;

            case AVException.USER_MOBILE_PHONENUMBER_TAKEN:
                exceptionDesc = "这个号码已经绑定过别的账号了";
                break;

            case AVException.USER_MOBILEPHONE_MISSING:
                exceptionDesc = "用户并没有绑定手机号码";
                break;

            case AVException.USER_MOBILEPHONE_NOT_VERIFIED:
                exceptionDesc = "这个手机号码尚未被验证过";
                break;

            case AVException.USER_WITH_MOBILEPHONE_NOT_FOUND:
                exceptionDesc = "没有找到绑定了该手机号的用户";
                break;

            case AVException.USER_DOESNOT_EXIST:
                exceptionDesc = "该用户不存在";
                break;

            case AVException.USER_ID_MISMATCH:
                exceptionDesc = "用户信息不匹配";
                break;

            case AVException.USERNAME_PASSWORD_MISMATCH:
                exceptionDesc = "账号密码错误";
                break;

            case AVException.INCORRECT_TYPE:
                exceptionDesc = "数据属性和数据库中属性不匹配";
                break;

            case AVException.OBJECT_NOT_FOUND:
                exceptionDesc = "没有找到任何数据";
                break;

            case AVException.INVALID_PHONE_NUMBER:
                exceptionDesc = "您输入的手机号码无效";
                break;

            case 601:
                exceptionDesc = "获取短信次数过频或超出当日短信限额，请您稍后再试";
                break;

            case 603:
                exceptionDesc = "未知错误";
                break;

            case AVException.INTERNAL_SERVER_ERROR:
                exceptionDesc = "服务器异常";
                break;

            case AVException.EMAIL_TAKEN:
                exceptionDesc = "该邮箱已被注册";
                break;

            case AVException.EMAIL_MISSING:
                exceptionDesc = "邮箱MISSING";
                break;

            case AVException.EMAIL_NOT_FOUND:
                exceptionDesc = "未找到邮箱";
                break;

            default:
                exceptionDesc = "" + e.getCode() ;
                break;
        }
        return exceptionDesc;
    }
}
